Resolve Mentz line versions, fix South Tyrolian SSP ids#113
Draft
leonardehrenfried wants to merge 16 commits into
Draft
Resolve Mentz line versions, fix South Tyrolian SSP ids#113leonardehrenfried wants to merge 16 commits into
leonardehrenfried wants to merge 16 commits into
Conversation
skinkie
reviewed
May 20, 2026
skinkie
reviewed
May 20, 2026
skinkie
reviewed
May 20, 2026
skinkie
reviewed
May 20, 2026
skinkie
reviewed
May 20, 2026
skinkie
reviewed
May 20, 2026
| existing_period: UicOperatingPeriod | None = None | ||
| if dta is not None: | ||
| period_ref = dta.uic_operating_period_ref_or_operating_period_ref_or_operating_day_ref_or_date | ||
| if hasattr(period_ref, 'ref'): |
Contributor
There was a problem hiding this comment.
You must check type, not just the attribute.
skinkie
reviewed
May 20, 2026
| updated_journeys: list[ServiceJourney] = [] | ||
| created: dict[tuple[str, str | None, str], str] = {} | ||
|
|
||
| for line_id, line_versions in lines.items(): |
Contributor
There was a problem hiding this comment.
I wonder if this can be more elegant.
skinkie
reviewed
May 20, 2026
skinkie
reviewed
May 20, 2026
skinkie
reviewed
May 20, 2026
| print(f"Inserting {len(new_ssps)} renamed ScheduledStopPoints") | ||
| # TODO: delete the old ScheduledStopPoint objects (no delete API available yet) | ||
|
|
||
| db.insert_any_object_on_queue(txn, updated) |
Contributor
There was a problem hiding this comment.
The more elegant way is to have a generator function here.
Author
There was a problem hiding this comment.
I have fixed this over here: #114
Lets get this merged first.
skinkie
reviewed
May 20, 2026
Author
|
I will temporarily make this into a draft so I can tests the changes I (well Claude) made. I will re-request a review when I'm done. Thanks so far. |
Contributor
|
@leonardehrenfried maybe splice up the scheduled stop point part too? |
Author
|
I don't think I understand what you mean with "splice". Send it in a separate PR? |
# Conflicts: # fix/rewrite_sta_ssp_ids.py
15ecd95 to
8e27af0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @skinkie,
thanks for the constructive meeting the other day. Lets try if we can collaborate because NeTEx tooling is sorely missing.
This PR adds the fix script for rewriting the Mentz line versions into new operating periods. There are very likely follow ups PRs coming but this is already good enough for code review.
It also adds another script for rewriting some South Tyrolian IDs.
cc @rcavaliere @clezag